<template>
  <div class="follow-detail">
    <div>
      <group>
        <cell title="患者">{{detail.patientUserCoreDTO.trueName}}</cell>
        <cell title="看诊地点">{{detail.province}}{{detail.city}}{{detail.district}}</cell>
      </group>
    </div>
    <div style="background: #fff;">
      <div class="p40">
        <div class="record-cell">复诊情况</div>
        <div class="main-symptom">
          {{detail.reviewSituation}}
        </div>
        <div style="color: #999;font-size: .3rem;">看诊时间：{{detail.inquiryTime}}</div>
      </div>
    </div>
    <div style="background: #fff;">
      <div class="p40">
        <div class="record-cell">用药情况</div>
        <div class="main-symptom">
          {{detail.useDrugSituation}}
        </div>
      </div>
    </div>
    <div style="background: #fff;">
      <div class="p40">
        <div class="record-cell">医生意见</div>
        <div class="advice-area">
          <textarea type="text" v-model="doctorOpinion" placeholder="输入医生意见" maxlength="500"></textarea>
        </div>
      </div>
    </div>
    <div class="btn-save" @click="handleClickSave">保存</div>
  </div>
</template>
<script>
  import {Group, Cell} from "vux";
  import {parseUrlParams} from "../../../wechat/static/util/util";
  let CONSTANT = require('../../../wechat/static/constant/constant.js'),
    common = require("../../../wechat/static/common/common.js"),
    wsService = require("../../../wechat/static/common/wechat-jsdk.js");

  export default {
    data() {
      return {
        detail: {},
        doctorOpinion: ""
      }
    },
    components: {
      Group, Cell
    },
    mounted() {
      this.getDetail()
    },
    methods: {
      getDetail() {
        common.requestAjax(CONSTANT.URL.PATIENT.FOLLOWDETAIL, {}, {id: parseUrlParams("id")}, (res) => {
          if (res.status == 200) {
            this.detail = res.data.bussData;
            this.doctorOpinion = this.detail.doctorOpinion;
          }
        })
      },
      handleClickSave() {
        let url = CONSTANT.URL.PATIENT.FOLLOWDOCTOROPINION;
        let params = {
          doctorOpinion: this.doctorOpinion,
          id: parseUrlParams("id")
        }
        common.requestAjax(url, JSON.stringify(params), {}, (res) => {
          if (res.status == 200) {
            this.$vux.alert.show({
              title: "提示",
              content: res.msg,
              onShow () {

              },
              onHide () {
              }
            })
          }
        })
      }
    }
  };
</script>
<style lang="less">
  .follow-detail {
    font-size: .34rem;
    height: 100%;
    background-color: #f4f4f4;
    .record-cell {
      border-left: .04rem solid #0063AE;
      padding-left: .14rem;
      position: relative;
      margin-bottom: .29rem;
    }

    .p40 {
      padding: .4rem .3rem .29rem .3rem;
    }
    .weui-cells {
      margin-top: 0!important;
    }

    .main-symptom {
      background-color: #f4f4f4;
      /*margin: 0 .3rem;*/
      height: 2.4rem;
      padding: .2rem;
      font-size: .3rem;
      color: #666;
      margin-bottom: .2rem;
    }

    .advice-area {
      /*padding: 0 .3rem;*/
      textarea {
        font-size: .3rem;
        border: none;
        width: 6.5rem;
        height: 2.4rem;
        padding: .2rem;
        background-color: #f4f4f4;
        &:focus {
          border: none;
          outline: 0;
        }
      }
    }
    .btn-save {
      width: 6.9rem;
      height: .88rem;
      line-height: .88rem;
      text-align: center;
      background-color: #0063AE;
      color: #fff;
      font-size: .36rem;
      border-radius: .1rem;
      margin: .84rem 0 .57rem .3rem;
    }
  }
</style>
